<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.10.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>l8w8jwt: include/l8w8jwt/encode.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="doxygen-awesome.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">l8w8jwt
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.10.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_4cc40c4817b6dd8b994fc53e2126ebc6.html">l8w8jwt</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#define-members">Macros</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle"><div class="title">encode.h File Reference</div></div>
</div><!--header-->
<div class="contents">

<p>Core ENCODE function for l8w8jwt. Use this to encode a JWT header + payload WITHOUT signing.  
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &quot;<a class="el" href="algs_8h_source.html">algs.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="claim_8h_source.html">claim.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="version_8h_source.html">version.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="retcodes_8h_source.html">retcodes.h</a>&quot;</code><br />
<code>#include &quot;timehelper.h&quot;</code><br />
<code>#include &lt;stddef.h&gt;</code><br />
</div><div class="textblock"><div class="dynheader">
Include dependency graph for encode.h:</div>
<div class="dyncontent">
<div class="center"><img src="encode_8h__incl.png" border="0" usemap="#ainclude_2l8w8jwt_2encode_8h" alt=""/></div>
<map name="ainclude_2l8w8jwt_2encode_8h" id="ainclude_2l8w8jwt_2encode_8h">
<area shape="rect" title="Core ENCODE function for l8w8jwt. Use this to encode a JWT header + payload WITHOUT signing." alt="" coords="143,5,308,32"/>
<area shape="rect" href="algs_8h.html" title="JWT algorithms as defined in https://tools.ietf.org/html/rfc7518#section&#45;3.1." alt="" coords="5,80,62,107"/>
<area shape="poly" title=" " alt="" coords="193,35,77,78,75,73,191,30"/>
<area shape="rect" href="claim_8h.html" title="JWT claims as described in https://auth0.com/docs/tokens/concepts/jwt&#45;claims." alt="" coords="86,80,149,107"/>
<area shape="poly" title=" " alt="" coords="208,35,151,73,148,69,205,30"/>
<area shape="rect" href="version_8h.html" title="l8w8jwt version checking." alt="" coords="163,155,235,181"/>
<area shape="poly" title=" " alt="" coords="225,33,215,80,205,140,200,139,210,80,220,32"/>
<area shape="rect" href="retcodes_8h.html" title="Macros for possible integer codes returned by the various l8w8jwt functions." alt="" coords="224,80,307,107"/>
<area shape="poly" title=" " alt="" coords="235,31,254,65,249,68,230,34"/>
<area shape="rect" href="timehelper_8h_source.html" title=" " alt="" coords="331,80,424,107"/>
<area shape="poly" title=" " alt="" coords="253,30,338,70,336,75,251,35"/>
<area shape="rect" title=" " alt="" coords="448,80,515,107"/>
<area shape="poly" title=" " alt="" coords="271,30,434,76,432,81,269,35"/>
<area shape="poly" title=" " alt="" coords="133,105,175,142,172,146,130,109"/>
<area shape="rect" title=" " alt="" coords="75,155,139,181"/>
<area shape="poly" title=" " alt="" coords="118,108,114,140,108,139,113,107"/>
<area shape="poly" title=" " alt="" coords="347,110,245,151,243,146,345,105"/>
<area shape="rect" title=" " alt="" coords="349,155,406,181"/>
<area shape="poly" title=" " alt="" coords="380,107,380,139,375,139,375,107"/>
</map>
</div>
</div>
<p><a href="encode_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="nested-classes" name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structl8w8jwt__encoding__params.html">l8w8jwt_encoding_params</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="define-members" name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:a6d1d36d8d5d96c745e2745d3810b31bc" id="r_a6d1d36d8d5d96c745e2745d3810b31bc"><td class="memItemLeft" align="right" valign="top"><a id="a6d1d36d8d5d96c745e2745d3810b31bc" name="a6d1d36d8d5d96c745e2745d3810b31bc"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>L8W8JWT_MAX_KEY_SIZE</b>&#160;&#160;&#160;8192</td></tr>
<tr class="separator:a6d1d36d8d5d96c745e2745d3810b31bc"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a9fb32622347f1de69947a311c9af8621" id="r_a9fb32622347f1de69947a311c9af8621"><td class="memItemLeft" align="right" valign="top">L8W8JWT_API void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a9fb32622347f1de69947a311c9af8621">l8w8jwt_encoding_params_init</a> (struct <a class="el" href="structl8w8jwt__encoding__params.html">l8w8jwt_encoding_params</a> *params)</td></tr>
<tr class="separator:a9fb32622347f1de69947a311c9af8621"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a489f0316311f70eaee999ea265838d65" id="r_a489f0316311f70eaee999ea265838d65"><td class="memItemLeft" align="right" valign="top">L8W8JWT_API int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a489f0316311f70eaee999ea265838d65">l8w8jwt_validate_encoding_params</a> (struct <a class="el" href="structl8w8jwt__encoding__params.html">l8w8jwt_encoding_params</a> *params)</td></tr>
<tr class="separator:a489f0316311f70eaee999ea265838d65"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac51d9592ef1a73a1db46147fc96bc584" id="r_ac51d9592ef1a73a1db46147fc96bc584"><td class="memItemLeft" align="right" valign="top">L8W8JWT_API int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ac51d9592ef1a73a1db46147fc96bc584">l8w8jwt_encode</a> (struct <a class="el" href="structl8w8jwt__encoding__params.html">l8w8jwt_encoding_params</a> *params)</td></tr>
<tr class="separator:ac51d9592ef1a73a1db46147fc96bc584"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Core ENCODE function for l8w8jwt. Use this to encode a JWT header + payload WITHOUT signing. </p>
<dl class="section author"><dt>Author</dt><dd>Raphael Beck </dd></dl>
</div><h2 class="groupheader">Function Documentation</h2>
<a id="ac51d9592ef1a73a1db46147fc96bc584" name="ac51d9592ef1a73a1db46147fc96bc584"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac51d9592ef1a73a1db46147fc96bc584">&#9670;&#160;</a></span>l8w8jwt_encode()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">L8W8JWT_API int l8w8jwt_encode </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structl8w8jwt__encoding__params.html">l8w8jwt_encoding_params</a> *</td>          <td class="paramname"><span class="paramname"><em>params</em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Creates, signs and encodes a Json-Web-Token. </p>
<p>An example output could be: <code>eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6InNvbWUta2V5LWlkLWhlcmUtMDEyMzQ1NiJ9.eyJpYXQiOjE1Nzk2NDUzNTUsImV4cCI6MTU3OTY0NTk1NSwic3ViIjoiR29yZG9uIEZyZWVtYW4iLCJpc3MiOiJCbGFjayBNZXNhIiwiYXVkIjoiQWRtaW5pc3RyYXRvciJ9.uk4EEoq0ql_SguLto5EWzklakpzO-6GE2U26crB8vUY</code> </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">params</td><td>The token encoding parameters (e.g. "alg", "iss", "exp", etc...). </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Return code as defined in <a class="el" href="retcodes_8h.html" title="Macros for possible integer codes returned by the various l8w8jwt functions.">retcodes.h</a> </dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="structl8w8jwt__encoding__params.html">l8w8jwt_encoding_params</a> </dd></dl>

</div>
</div>
<a id="a9fb32622347f1de69947a311c9af8621" name="a9fb32622347f1de69947a311c9af8621"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9fb32622347f1de69947a311c9af8621">&#9670;&#160;</a></span>l8w8jwt_encoding_params_init()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">L8W8JWT_API void l8w8jwt_encoding_params_init </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structl8w8jwt__encoding__params.html">l8w8jwt_encoding_params</a> *</td>          <td class="paramname"><span class="paramname"><em>params</em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Initializes a <code><a class="el" href="structl8w8jwt__encoding__params.html">l8w8jwt_encoding_params</a></code> instance by setting its fields to default values. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">params</td><td>The <a class="el" href="structl8w8jwt__encoding__params.html">l8w8jwt_encoding_params</a> to initialize (set to default values). </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a489f0316311f70eaee999ea265838d65" name="a489f0316311f70eaee999ea265838d65"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a489f0316311f70eaee999ea265838d65">&#9670;&#160;</a></span>l8w8jwt_validate_encoding_params()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">L8W8JWT_API int l8w8jwt_validate_encoding_params </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structl8w8jwt__encoding__params.html">l8w8jwt_encoding_params</a> *</td>          <td class="paramname"><span class="paramname"><em>params</em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Validates a set of <a class="el" href="structl8w8jwt__encoding__params.html">l8w8jwt_encoding_params</a>. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">params</td><td>The <a class="el" href="structl8w8jwt__encoding__params.html">l8w8jwt_encoding_params</a> to validate. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Return code as defined in <a class="el" href="retcodes_8h.html" title="Macros for possible integer codes returned by the various l8w8jwt functions.">retcodes.h</a> </dd></dl>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.10.0
</small></address>
</body>
</html>
